FUN=
VER=

#------------------------ GCC编译器和编译参数 ------------
CC=gcc

CCFLAGS= -O2 -g -Wall -Wextra -Wunused-variable -Wunused-parameter \
		 -Wreturn-type -Wfloat-equal -Wformat -Wno-format-extra-args \
		 -Wuninitialized -Wundef -Wpointer-sign -Wmissing-declarations 

CFLAGS=$(CCFLAGS)

#------------------------ 连接头文件和函数库 ------------
INCLUDE=-I. -I./inc/ -I./usr/include 

CFLAGS+= $(INCLUDE)
CLIBS= -L. -L./usr/lib  -L./usr/lib64 -lm -lc -lrt -lssl 

#------------------------ 目录设定 -------------------------

INCDIR=../../inc/
SRCDIR=../../src/
OBJDIR=./objs/

$(shell mkdir -p $(OBJDIR) )

#------------------------ 文件设定 -------------------------

OBJS=$(OBJDIR)mos_string.o  $(OBJDIR)str_test.o 


CFGINC= $(INCDIR)mos_def.h  $(INCDIR)mos_string.h  $(INCDIR)mos_util.h 


#------------------------ 编译设定  -------------------------


all:Strtest


$(OBJDIR)mos_string.o: $(SRCDIR)mos_string.c 
	$(CC) -c $(SRCDIR)mos_string.c $(CFLAGS)
	mv mos_string.o $(OBJDIR)mos_string.o

$(OBJDIR)str_test.o: str_test.c 
	$(CC) -c str_test.c $(CFLAGS)
	mv str_test.o $(OBJDIR)str_test.o



Strtest: $(OBJS) 
	$(CC) -o Strtest $(OBJS) $(CFLAGS) $(CLIBS) 


.PHONY:clean
clean:
	rm -fr $(OBJDIR) $(BINDIR) Strtest 

